package com.summer.mall.mapper;

import com.summer.mall.entity.Product;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    Product selectById(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    int updateStatusById(@Param("id") Integer id,@Param("status") Integer status);

    List<Product> selectProductList();

    List<Product> selectByNameAndProductId(@Param("productId") Integer productId, @Param("productName") String productName);

    List<Product> selectByCategoryIds(@Param("productIds")List<Integer> productIds);

    List<Product>  selectByNameAndCategoryIds(@Param("productIds") List<Integer> productIds,@Param("productName") String productName);

    int getCount();

    int getCountByNameLike(@Param("thename") String thename);
}
